//
//  AzirClientInterceptorFactory.swift
//  Center_RPC
//
//  Created by 蒋晨成 on 2021/12/29.
//

import Center_Core_Model
import Foundation
import GRPC
import NIO

class AzirClientInterceptorFactory {}

extension AzirClientInterceptorFactory: Azir_Gateway_LoginClientInterceptorFactoryProtocol {
    func makeSendSMSInterceptors() -> [ClientInterceptor<Azir_Gateway_SendSMSRequest, Azir_Gateway_SendSMSResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }

    func makeMobileAuthInterceptors() -> [ClientInterceptor<Azir_Gateway_MobileAuthRequest, Azir_Gateway_MobileAuthResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }

    func makeLogoutInterceptors() -> [ClientInterceptor<Azir_Gateway_LogoutRequest, Azir_Gateway_LogoutResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }

    func makeAppleAuthInterceptors() -> [ClientInterceptor<Azir_Gateway_AppleAuthRequest, Azir_Gateway_AppleAuthResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }

    func makeWechatAuthInterceptors() -> [ClientInterceptor<Azir_Gateway_WechatAuthRequest, Azir_Gateway_WechatAuthResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }

    func makeUserLoginInterceptors() -> [ClientInterceptor<Azir_Gateway_UserLoginRequest, Azir_Gateway_UserLoginResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }

    func makeChangePasswordInterceptors() -> [ClientInterceptor<Azir_Gateway_ChangePasswordRequest, Azir_Gateway_ChangePasswordResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }
}

extension AzirClientInterceptorFactory: Azir_Gateway_UserClientInterceptorFactoryProtocol {
    func makeUpdateBasicProfileInterceptors() -> [ClientInterceptor<Azir_Gateway_UpdateBasicProfileRequest, Azir_Gateway_UpdateBasicProfileResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }

    func makeGetUserProfileInterceptors() -> [ClientInterceptor<Azir_Gateway_GetUserProfileRequest, Azir_Gateway_GetUserProfileResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }
}

extension AzirClientInterceptorFactory: Azir_Gateway_UploadClientInterceptorFactoryProtocol {
    func makeGetUploadTokenInterceptors() -> [ClientInterceptor<Azir_Gateway_GetUploadTokenRequest, Azir_Gateway_GetUploadTokenResponse>] {
        [
            LoggingClientInterceptor(),
            ResponseHandlerInterceptor(),
        ]
    }
}
